% main test
clc;clear;
global digits;
global dimension;
digits = 10;
dimension = 4;
% binary code represent as follow, first high digit represent
% positive/negative notation, rest digits represent content
% test_vector = rand(1,4) *  20 - 10;
test_bin = dec_to_binary(-10, 6);     % [1,1,0,1,1,0]
test_bin1 = dec_to_binary(-10, 7);
test_bin1 = dec_to_binary(10, 6);     % [0,0,1,0,1,0]
test_dec = binary_to_dec([0,0,1,0,1,0]);   % 10
test_dec1 = binary_to_dec([1,0,1,0,1,0]);  % -22
test_vector = [-4.1233, 0.1345, 1.2390, -18.2313];
bin_vector = dec_to_binary_vector(test_vector);
binary_to_dec_vector(bin_vector);